package com.suse.lhw.resourceservere.client;

import com.netflix.client.http.HttpResponse;
import com.suse.lhw.domin.FFoodmodel;
import com.suse.lhw.domin.FPackage;
import com.suse.lhw.domin.FPackageToFFoodmodel;
import com.suse.lhw.domin.FUnit;
import com.suse.lhw.hms.foodserver.pojo.input_POJO.ModelUnitAndIfo;
import com.suse.lhw.hms.foodserver.pojo.output_POJO.FIAndName;
import com.suse.lhw.resourceservere.POJO.input_POJO.*;
import com.suse.lhw.resourceservere.POJO.output_POJO.PackageAndAllModels;
import com.suse.lhw.resourceservere.POJO.output_POJO.ofm_selectFoodIfoByModelId;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @ProjectName: health_manage_system
 * @Package: com.suse.lhw.resourceservere.client
 * @ClassName: foodserverClient
 * @Description: java类作用描述
 * @Author: 李鸿炜
 * @CreateDate: 2020/4/18 9:23
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/4/18 9:23
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */

@FeignClient("FOODSERVER")
public interface foodserverClient {

    @RequestMapping("fooduser/addAUnuploadedFoodModel")
    public String addAUnuploadedFoodModel(@RequestBody model_ifo_units model_ifo_units);

    @RequestMapping("/hello")
    public String hello();

    @RequestMapping("fooduser/findAllFoodModelsOfDefault")
    public List<FFoodmodel> findAllFoodModelsOfDefault(@RequestParam Model model);

    @RequestMapping("fooduser/eatAFoodByModelId")
    public String eatAFoodByModelId(@RequestParam int foodId, @RequestParam int unitId, @RequestParam int quanity, @RequestParam int eattime);

    @RequestMapping("fooduser/splitOutAFoodByModelId")
    public String splitOutAFoodByInstanceId(@RequestParam int InstanceId);

    @RequestMapping("fooduser/addAUnUploadPackage")
    public String addAPackageOfUser(package_fmids p);

    @RequestMapping("fooduser/deleteAUnUploadPackage")
    public String deldeteAUnUploadPackage(@RequestParam int pakcageId);

    @RequestMapping("fooduser/deleteAFoodModel")
    public String deleteAFoodModel(@RequestParam int foodid);

    @RequestMapping("fooduser/uploadAPackage")
    public String uploadAPakcage(@RequestParam int packageId);

    @RequestMapping("fooduser//eatAPackage")
    public String eatAPackage(@RequestParam int status, @RequestParam int packaeid, @RequestBody List<eatAPackage> ptmList);

    @PostMapping("fooduser/splitOutAPackageByPackageId")
    public String splitOutAPackageByPackageId(@RequestParam int packageId);

    @RequestMapping("fooduser/selectAllPackageByType")
    public List<PackageAndAllModels> selectAllDefaultPackage(@RequestParam int type);

    @RequestMapping("fooduser/collectAModelOrPackage")
    public String collectAModelOrPackage(@RequestParam int id, @RequestParam int type);

    @RequestMapping("fooduser/cancelACollection")
    public String cancleACollectionById(@RequestParam int id);

    @RequestMapping("fooduser/selectPackageCollection")
    public List<FPackage> selectPackageCollection();

    @RequestMapping("fooduser/selectModelCollection")
    public List<FFoodmodel> selectCodelCollection();

    @PostMapping("foodmanager/addAFoodModel")    //增加四个字段，Foodmodel,f_foodmodel_to_f_foodmodel_unit,f_unit,f_food_ifo
    public String addAFoodModel(@RequestParam Model model, @RequestParam addAFoodModel pojo, @RequestBody List<FUnit> list);

    @PostMapping("foodmanager/deleteADefautFoodModel")
    public String deleteADefaultFoodModel(@RequestParam Integer foodmodelId);

    @GetMapping("foodmanager/findAllFoodModelsOfDefault")
    public void findAllFoodModelsOfDefault(@RequestParam HttpResponse response, @RequestParam HttpServletRequest request, @RequestParam Model model);

    @GetMapping("foodmanager/selectFoodIfoByModelId")
    public ofm_selectFoodIfoByModelId selectFoodIfoById(@RequestParam int modelId, @RequestParam Model model);

    @PostMapping("foodmanager/updateAFoodModel")
    public String updateAfoodModel(@RequestParam FFoodmodel fFoodmodel);

    @PostMapping("foodmanager/updateFoodUnits")
    public String updateFoodUnits(@RequestBody List<FUnit> list);

    @PostMapping("foodmanager/addADefaultPackage")
    public String addADefaultPackage(@RequestParam FPackage fPackage, @RequestBody List<FPackageToFFoodmodel> list);

    @PostMapping("foodmanager/deleteADefaultPackageById")
    public String deleteADefaultPackageById(@RequestParam int id);

    @GetMapping("foodmanager/selectAllDefaultPackage")
    public List<FPackage> selectAllDefaultPackage();

    @GetMapping("foodmanager/selectAllModelByPackageId")
    public List<ofm_selectFoodIfoByModelId> selectAllModelByPackageId(int packageId);

    @PostMapping("foodmanager/updateAPackageByPackageId")
    public String updateAPackageByPackageId(@RequestParam FPackage fPackage);

    @PostMapping("foodmanager/addAModelOfPackage")
    public String addAModelOfPackage(@RequestParam int packageId, @RequestParam int modelId);

    @PostMapping("foodmanager/deleteAModelOfPackage")
    public String deleteAModelOfPakcage(@RequestParam int packageId, @RequestParam int modelId);

    @RequestMapping("fooduser/selectModelByNameStatusUserid")
    public List<modelAndUnits> selectModelByNameStatusUserid(@RequestParam(required = false) String name, @RequestParam(required = false) int status, @RequestParam(required = false) String userId);

    @RequestMapping("fooduser/findAFoodModelById")
    public ModelUnitAndIfo findAFoodModelById(@RequestParam int id);

    @RequestMapping("fooduser/selectFIsByUserId")
    public List<FIAndName> selectFIsByUserId();
}
